package rhc.taskSchedule.entity;

import java.util.HashMap;
import java.util.Map;

/**正在运行类型
 * @author lenovo
 *
 */
public enum RunningType {
	TASK("task",Task.class,"任务"),SCHEDULE("schedule",TaskSchedule.class,"调度");
	public String type;
	public Class runClass;
	public String desc;
	RunningType(String type,Class runClass,String desc){
		this.type=type;
		this.runClass=runClass;
		this.desc=desc;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Class getRunClass() {
		return runClass;
	}
	public void setRunClass(Class runClass) {
		this.runClass = runClass;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	private static final Map<String,RunningType> type_runningType=new HashMap<String,RunningType>();
	static{
		for(RunningType rt:RunningType.values()){
			type_runningType.put(rt.type, rt);
		}
	}
	
	public static RunningType getRTByType(String type){
		return type_runningType.get(type);
	}
}
